#include "comm.h"

//返回电子表方式显示时间的字符串表示,需要用g_free释放
gchar *get_clock_string(double sec){
	int h,m,s;
	int last = sec;
	h = last / (60*60);
	last %= (60*60);
	m = last / 60;
	last %= 60;
	s = last;
	//double ms = sec - ((int)sec);
	double i_part = 0.0;
	double ms = modf(sec,&i_part);
	return g_strdup_printf("%02d:%02d:%02d.%04d",h,m,s,(int)(ms*10000));
}